import Http from '../http';

export const login = function(loginForm: any) {
    return Http.post('/saToken/user/login', loginForm)
}

export const menu = function() {
    return Http.get('/sysMenu/tree')
}

export const permission = function() {
    return Http.get('/sysMenu/loadPermissions')
}
// 分页查询
export const listByLimit = function(queryWhere: any) {
    return Http.post('/sysUser/queryForPage',queryWhere)
}

// 超级管理员新增用户
export const saveBySuper = function(userInfo: any) {
    return Http.post('/sysUser/insertBySuper',userInfo)
}

// 超级管理员编辑用户
export const updateBySuper = function(userInfo: any) {
    return Http.put('/sysUser/updateUser',userInfo)
}

// 超级管理员删除用户
export const delBySuper = function(dels: any) {
    return Http.delete(`/sysUser/dels?idList=${dels}`,{})
}

// 超级管理员批量删除用户
export const delsBySuper = function(delUrl: any) {
    return Http.delete(`/sysUser/dels${delUrl}`,{})
}

// 部门树查询
export const queryTree = function(userId: any) {
    return Http.post(`/sysDept/queryTree?userId=${userId}`,{})
}